//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class CBSphere {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CBSphere(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CBSphere obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CBSphere(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setCenter(CVector value) {
    nelmiscJNI.CBSphere_Center_set(swigCPtr, this, CVector.getCPtr(value), value);
  }

  public CVector getCenter() {
    return new CVector(nelmiscJNI.CBSphere_Center_get(swigCPtr, this), true);
  }

  public void setRadius(float value) {
    nelmiscJNI.CBSphere_Radius_set(swigCPtr, this, value);
  }

  public float getRadius() {
    return nelmiscJNI.CBSphere_Radius_get(swigCPtr, this);
  }

  public CBSphere() {
    this(nelmiscJNI.new_CBSphere__SWIG_0(), true);
  }

  public CBSphere(CVector center, float radius) {
    this(nelmiscJNI.new_CBSphere__SWIG_1(CVector.getCPtr(center), center, radius), true);
  }

  public void applyTransform(CMatrix mat, CBSphere res) {
    nelmiscJNI.CBSphere_applyTransform(swigCPtr, this, CMatrix.getCPtr(mat), mat, CBSphere.getCPtr(res), res);
  }

  public boolean clipFront(CPlane p) {
    return nelmiscJNI.CBSphere_clipFront(swigCPtr, this, CPlane.getCPtr(p), p);
  }

  public boolean clipBack(CPlane p) {
    return nelmiscJNI.CBSphere_clipBack(swigCPtr, this, CPlane.getCPtr(p), p);
  }

  public boolean include(CVector p) {
    return nelmiscJNI.CBSphere_include__SWIG_0(swigCPtr, this, CVector.getCPtr(p), p);
  }

  public boolean include(CBSphere s) {
    return nelmiscJNI.CBSphere_include__SWIG_1(swigCPtr, this, CBSphere.getCPtr(s), s);
  }

  public boolean intersect(CBSphere s) {
    return nelmiscJNI.CBSphere_intersect(swigCPtr, this, CBSphere.getCPtr(s), s);
  }

  public void setUnion(CBSphere sa, CBSphere sb) {
    nelmiscJNI.CBSphere_setUnion(swigCPtr, this, CBSphere.getCPtr(sa), sa, CBSphere.getCPtr(sb), sb);
  }

}
